// 引入token集合构造函数
const Token = require("../../../model/token");

module.exports = async (req, res) => {
  // 获取query参数中的token值
  const token = req.query.token;
  // 查找token
  let result = await Token.findOne({ token });
  const { username, role, uid } = result;
  res.send({
    username,
    role,
    uid
  });
};
